<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对话记录查询</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>

<header>
    <h1>对话记录查询</h1>
</header>

<div class="container">
    <form method="GET" action="/">
        <h2>搜索对话记录</h2>
        <input type="text" name="keyword" placeholder="关键词搜索" value="{{ keyword or '' }}">
        <input type="date" name="start_date" value="{{ start_date or '' }}">
        <input type="date" name="end_date" value="{{ end_date or '' }}">
        <button type="submit">搜索</button>
    </form>

    <table>
        <thead>
            <tr>
                <th>ID</th>
                <th>用户消息</th>
                <th>坐席消息</th>
                <th>对话总结</th>
                <th>标签</th>
                <th>时间</th>
            </tr>
        </thead>
        <tbody>
            {% for dialog in dialogs %}
            <tr>
                <td>{{ dialog[0] }}</td>
                <td>{{ dialog[3] }}</td>
                <td>{{ dialog[4] }}</td>
                <td>{{ dialog[5] }}</td>
                <td>{{ dialog[6] }}</td>
                <td>{{ dialog[7] }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>

</body>
</html>
